package com.crm.customers.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.customers.dao.ExpressDao;
import com.crm.customers.model.Express;
@Repository("expressDao")
public class ExpressDaoImpl  extends BaseDao  implements ExpressDao{

	private  static final String MAPPER_NAMESAPCE = "ExpressMapper.";
	
	@Override
	public Express saveExpress(Express c) {
		insert(MAPPER_NAMESAPCE+"saveExpress", c);
		return c;
	}

	@Override
	public int updateExpress(Express c) {
		return  update(MAPPER_NAMESAPCE+"updateExpress", c);
	}

	@Override
	public List<Express> getExpress(Express c) {
		List<Express> list = selectList(MAPPER_NAMESAPCE+"getAllExpressListByParams", c);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getAllExpressListCountByParams", c));
		}
		return list;
	}

}
